{include file="public/header" select="0" /}
<body>
<div class="title bgc">
    <i class="layui-icon layui-icon-left" onclick="goBack()"></i>
    充值
</div>
<form action="{:url('remit/save')}" method="post" class="form layui-form">
    <ul class="set-form bgc">

        <li>
            <span>充值方式</span>
            <div>
                <select name="pay_way" lay-filter="mode">
                    <option value="微信">微信</option>
                    <option value="支付宝">支付宝</option>
                    <option value="银行卡">银行卡</option>
                </select>
            </div>
        </li>

        <li class="wechat right_parent">
            <span>微信收款码</span>
            <div class="right_div">
                <img class="right_img images" src="{:cache('system')['remit_wechat']}" alt="">
            </div>
        </li>

        <li class="alipay right_parent" style="display: none">
            <span>支付宝收款码</span>
            <div class="right_div">
                <img class="right_img images" src="{:cache('system')['remit_alipay']}" alt="">
            </div>
        </li>

        <li class="bank" style="display: none">
            <span>银行名称</span>
            <label><input type="text" value="{:cache('system')['remit_bank_name']}" placeholder="银行名称" readonly></label>
        </li>
        <li class="bank" style="display: none">
            <span>开户行</span>
            <label><input type="text" value="{:cache('system')['remit_bank_open']}" placeholder="开户行" readonly></label>
        </li>
        <li class="bank" style="display: none">
            <span>银行户名</span>
            <label><input type="text" value="{:cache('system')['remit_bank_account']}" placeholder="银行户名" readonly></label>
        </li>
        <li class="bank" style="display: none">
            <span>银行账号</span>
            <label><input type="text" class="copy_content" value="{:cache('system')['remit_bank_number']}" placeholder="银行账号" readonly>
                <span class="copy" data-clipboard-action="copy" data-clipboard-target=".copy_content" style="color: red">复制</span>
            </label>
        </li>

    </ul>
    <ul class="set-form bgc">
        <li>
            <span>充值金额</span>
            <label>
                <input type="text" lay-verify="required" lay-reqtext="请填写充值金额" lay-verType="tips"
                          name="amount" placeholder="请填写充值金额，{:cache('system')['remit_min']}起充" autocomplete="off"
                       onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
            </label>
        </li>
        <li class="right_parent">
            <span>支付凭证</span>
            <div class="right_div" id="uploads_image">
                <img class="right_img" src="/static/index/img/upload_img.png" alt="" id="image_show">
                <input type="hidden" name="images" id="images_value" value="" lay-verify="required" lay-reqtext="请上传支付凭证"
                       placeholder="请上传支付凭证"/>
            </div>
        </li>
    </ul>
    {if !cache('system')['remit_open']}
    <div class="pay-btn" style="background-color: #8D8D8D"><a>无法充值</a></div>
    {else}
    <div class="pay-btn" lay-submit lay-filter="save" formObj=".form"><a>充值</a></div>
    {/if}

</form>
<div class="pay-btn tran-btn"><a href="{:url('remit/record')}">充值记录</a></div>
</body>
<img alt="" style="display:none;width: 100%;height: auto" id="displayimg" src="" />
{include file="public/footer" select="0" /}
<script src="/static/index/js/clipboard.min.js"></script>
<script src="/static/index/js/utf.js"></script>
<script>
    $('.images').click(function () {
        DataHtml('收款码', $(this).attr('src'))
    });

    $('.copy').click(function () {
        var clipboard = new ClipboardJS('.copy');
        layer.msg('复制成功');
    })

    function DataHtml(name, url) {
        $("#displayimg").attr("src", url);
        var height = $("#displayimg").height();
        var width = $("#displayimg").width();
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            shadeClose: true,
            area: [width + 'px', 'auto'], //宽高
            content: "<img style='width: 100%' alt=" + name + " title=" + name + " src=" + url + " />"
        });
    }
</script>